package com.iman.manjusri.mappers;

import com.iman.manjusri.mappers.models.DrmUserSinfo;
import com.iman.manjusri.mappers.models.DrmUserSinfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmUserSinfoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int countByExample(DrmUserSinfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int deleteByExample(DrmUserSinfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Delete({
        "delete from drm_user_sinfo",
        "where user_id = #{userId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Insert({
        "insert into drm_user_sinfo (user_id, user_gread, ",
        "user_integral, user_credit, ",
        "user_learncredit, lastupdate_dt)",
        "values (#{userId,jdbcType=BIGINT}, #{userGread,jdbcType=VARCHAR}, ",
        "#{userIntegral,jdbcType=INTEGER}, #{userCredit,jdbcType=INTEGER}, ",
        "#{userLearncredit,jdbcType=INTEGER}, #{lastupdateDt,jdbcType=TIMESTAMP})"
    })
    int insert(DrmUserSinfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int insertSelective(DrmUserSinfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    List<DrmUserSinfo> selectByExample(DrmUserSinfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Select({
        "select",
        "user_id, user_gread, user_integral, user_credit, user_learncredit, lastupdate_dt",
        "from drm_user_sinfo",
        "where user_id = #{userId,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmUserSinfo selectByPrimaryKey(Long userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmUserSinfo record, @Param("example") DrmUserSinfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByExample(@Param("record") DrmUserSinfo record, @Param("example") DrmUserSinfoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByPrimaryKeySelective(DrmUserSinfo record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Update({
        "update drm_user_sinfo",
        "set user_gread = #{userGread,jdbcType=VARCHAR},",
          "user_integral = #{userIntegral,jdbcType=INTEGER},",
          "user_credit = #{userCredit,jdbcType=INTEGER},",
          "user_learncredit = #{userLearncredit,jdbcType=INTEGER},",
          "lastupdate_dt = #{lastupdateDt,jdbcType=TIMESTAMP}",
        "where user_id = #{userId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmUserSinfo record);
}